package com.duduya.platforms.weixin.bean.sys;

public class ReturnResponse {
	private static final String OK = "10000";  
    private static final String ERROR = "20000";
    private static final String MSG_OK = "Success";
    private static final String MSG_ERROR = "Fail";
  
    private String code;
    private String msg;
    private String token;
    private Object data;  
  
    public ReturnResponse success() {  
        this.code = OK;
        this.msg = MSG_OK;
        return this;  
    }  
  
    public ReturnResponse success(Object data, String token) {  
        this.code = OK;
        this.msg = MSG_OK;
        this.token = token;
        this.data = data;  
        return this;  
    }  
  
    public ReturnResponse failure() {  
        this.code = ERROR;
        this.msg = MSG_ERROR;
        return this;  
    }  
  
    public ReturnResponse failure(String message) {  
    	this.code = ERROR;
        this.msg = message;
        return this;  
    }
    
    public ReturnResponse failure(String code, String message) {  
    	this.code = code;
        this.msg = message;
        return this;  
    } 
  
    public Object getData() {  
        return data;  
    }

	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}
}
